package com.xinghou.platform.entity.req;

import org.springframework.util.StringUtils;

/**
 * Created by liufangyu on 2016/7/12.
 */
public class ListReq extends BaseReq{
    private String userid;
    private String subjectid;
    private String id;
    private String starttime;
    private String endtime;
    private String fromno;
    private String pageno;
    private String pagesize;
    private String order;
    private String filter;
    private String logincount;
    private String cardcount;
    private String fanscount;
    private String attentioncount;
    private String visitcount;
    private String issign;
    private String operator;
    private String timestamp;

    private String uid;
    public String getId() {
        return id;
    }

    public ListReq setId(String id) {
        this.id = id;
        return this;
    }

    private String closuretime;

    private String searchvalue;

    private String searchkey;

    private String closuretype;

    private String closurereason;

    private String type;

    private String province;

    private String city;

    private String region;

    private String storeid;

    private String category;

    private String transactiontype;

    private String ids;

    private String audit;

    public String getType() {
        return type;
    }

    public ListReq setType(String type) {
        this.type = type;
        return this;
    }

    public String getAttentioncount() {
        return attentioncount;
    }

    public ListReq setAttentioncount(String attentioncount) {
        this.attentioncount = attentioncount;
        return this;
    }

    public String getIds() {
        return ids;
    }

    public ListReq setIds(String ids) {
        this.ids = ids;
        return this;
    }

    public String getCardcount() {
        return cardcount;
    }

    public ListReq setCardcount(String cardcount) {
        this.cardcount = cardcount;
        return this;
    }

    public String getCategory() {
        return category;
    }

    public ListReq setCategory(String category) {
        this.category = category;
        return this;
    }

    public String getCity() {
        return city;
    }

    public ListReq setCity(String city) {
        this.city = city;
        return this;
    }

    public String getClosurereason() {
        return closurereason;
    }

    public ListReq setClosurereason(String closurereason) {
        this.closurereason = closurereason;
        return this;
    }

    public String getClosuretime() {
        return closuretime;
    }

    public ListReq setClosuretime(String closuretime) {
        this.closuretime = closuretime;
        return this;
    }

    public String getClosuretype() {
        return closuretype;
    }

    public ListReq setClosuretype(String closuretype) {
        this.closuretype = closuretype;
        return this;
    }

    public String getEndtime() {
        return endtime;
    }

    public ListReq setEndtime(String endtime) {
        this.endtime = endtime;
        return this;
    }

    public String getFanscount() {
        return fanscount;
    }

    public ListReq setFanscount(String fanscount) {
        this.fanscount = fanscount;
        return this;
    }

    public String getFilter() {
        return filter;
    }

    public ListReq setFilter(String filter) {
        this.filter = filter;
        return this;
    }

    public String getLogincount() {
        return logincount;
    }

    public ListReq setLogincount(String logincount) {
        this.logincount = logincount;
        return this;
    }

    public String getOperator() {
        return operator;
    }

    public ListReq setOperator(String operator) {
        this.operator = operator;
        return this;
    }

    public String getProvince() {
        return province;
    }

    public ListReq setProvince(String province) {
        this.province = province;
        return this;
    }

    public String getRegion() {
        return region;
    }

    public ListReq setRegion(String region) {
        this.region = region;
        return this;
    }

    public String getStarttime() {
        return starttime;
    }

    public ListReq setStarttime(String starttime) {
        this.starttime = starttime;
        return this;
    }

    public String getStoreid() {
        return storeid;
    }

    public ListReq setStoreid(String storeid) {
        this.storeid = storeid;
        return this;
    }

    public String getSubjectid() {
        return subjectid;
    }

    public ListReq setSubjectid(String subjectid) {
        this.subjectid = subjectid;
        return this;
    }

    public String getTransactiontype() {
        return transactiontype;
    }

    public ListReq setTransactiontype(String transactiontype) {
        this.transactiontype = transactiontype;
        return this;
    }

    public String getUserid() {
        return userid;
    }

    public ListReq setUserid(String userid) {
        this.userid = userid;
        return this;
    }

    public String getVisitcount() {
        return visitcount;
    }

    public ListReq setVisitcount(String visitcount) {
        this.visitcount = visitcount;
        return this;
    }

    public String getSearchkey() {
        return searchkey;
    }

    public ListReq setSearchkey(String searchkey) {
        this.searchkey = searchkey;
        return this;
    }

    public String getSearchvalue() {
        return searchvalue;
    }

    public ListReq setSearchvalue(String searchvalue) {
        this.searchvalue = searchvalue;
        return this;
    }

    public String getFromno() {
        if(!StringUtils.isEmpty(fromno)){
            return fromno;
        }else{
            return String.valueOf((Integer.parseInt(pageno)-1)*Integer.parseInt(pagesize));
        }
    }

    public ListReq setFromno(String fromno) {
        this.fromno = fromno;
        return this;
    }

    public String getOrder() {
        return order;
    }

    public ListReq setOrder(String order) {
        this.order = order;
        return this;
    }

    public String getPageno() {
        return pageno;
    }

    public ListReq setPageno(String pageno) {
        this.pageno = pageno;
        return this;
    }

    public String getPagesize() {
        if(StringUtils.isEmpty(pagesize)){
            return "20";
        }else{
            return pagesize;
        }

    }

    public ListReq setPagesize(String pagesize) {
        this.pagesize = pagesize;
        return this;
    }

    public String getIssign() {
        return issign;
    }

    public ListReq setIssign(String issign) {
        this.issign = issign;
        return this;
    }

    public String getAudit() {
        return audit;
    }

    public ListReq setAudit(String audit) {
        this.audit = audit;
        return this;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public ListReq setTimestamp(String timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    public String getUid() {
        return uid;
    }

    public ListReq setUid(String uid) {
        this.uid = uid;
        return this;
    }
}
